﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace ThouShaltNotBrick.Logic.Helpers
{
    /// <summary>
    /// Constants.
    /// 'm' represents virtual (in-game) meter.
    /// </summary>
    public static class Constants
    {
        #region Constants
        #region Game
        public const int BRICK_ROWS = 20;
        public const int BRICK_COLUMNS = 20;
        public const int MAX_NUM_BRICKS = BRICK_ROWS * BRICK_COLUMNS;
        #endregion

        #region Size/Offset
        /// <summary>
        /// LEVEL_WIDTH / LEVEL_HEIGHT
        /// </summary>
        public const float LEVEL_ASPECT_RATIO = 1.6f;

        /// <summary>
        /// Level height [m].
        /// </summary>
        public const float LEVEL_HEIGHT = 100.0f;

        /// <summary>
        /// Inverse of level height [1/m].
        /// </summary>
        public const float INVERSE_LEVEL_HEIGHT = 1.0f / LEVEL_HEIGHT;

        /// <summary>
        /// Level width [m].
        /// </summary>
        public const float LEVEL_WIDTH = LEVEL_ASPECT_RATIO * LEVEL_HEIGHT;

        /// <summary>
        /// Inverse of level width [1/m].
        /// </summary>
        public const float INVERSE_LEVEL_WIDTH = 1.0f / LEVEL_WIDTH;

        #region Pad
        /// <summary>
        /// Pad width [m].
        /// </summary>
        public const float PAD_WIDTH = Constants.LEVEL_WIDTH / 10.0f;

        /// <summary>
        /// Pad half-width [m].
        /// </summary>
        public const float PAD_HALF_WIDTH = PAD_WIDTH / 2.0f;

        /// <summary>
        /// Pad height [m].
        /// </summary>
        public const float PAD_HEIGHT = Constants.LEVEL_HEIGHT / 50.0f;

        /// <summary>
        /// Initial x-position of pad center [m].
        /// </summary>
        public const float PAD_INITIAL_POSITION_X = Constants.LEVEL_WIDTH / 2.0f;

        /// <summary>
        /// Y-position of pad bottom [m].
        /// </summary>
        public const float PAD_POSITION_Y = Constants.LEVEL_HEIGHT / 100.0f;
        #endregion

        #region Ball
        /// <summary>
        /// Ball radius [m].
        /// </summary>
        public const float BALL_RADIUS = LEVEL_WIDTH / 160.0f;

        /// <summary>
        /// Ball diameter [m].
        /// </summary>
        public const float BALL_DIAMETER = 2.0f * BALL_RADIUS;

        /// <summary>
        /// Initial ball x-position [m].
        /// </summary>
        public const float BALL_INITIAL_POSITION_X = LEVEL_WIDTH * 0.5f;

        /// <summary>
        /// Initial ball y-position [m].
        /// </summary>
        public const float BALL_INITIAL_POSITION_Y = LEVEL_HEIGHT * 0.2f;

        /// <summary>
        /// Ball speed [m/s].
        /// </summary>
        public const float BALL_SPEED = 100.0f;

        /// <summary>
        /// Angle of initial ball trajectory [rad].
        /// </summary>
        public const float BALL_INITIAL_TRAJECTORY_ANGLE = MathHelper.PiOver4;
        #endregion

        #region Brick
        /// <summary>
        /// Brick width [m].
        /// </summary>
        public const float BRICK_WIDTH = LEVEL_WIDTH / Constants.BRICK_COLUMNS;

        /// <summary>
        /// Brick height [m].
        /// </summary>
        public const float BRICK_HEIGHT = LEVEL_HEIGHT / (2.0f * Constants.BRICK_ROWS);

        /// <summary>
        /// Offset of bottom row of bricks from bottom of the screen [m].
        /// </summary>
        public const float BRICKS_Y_OFFSET = LEVEL_HEIGHT * 0.4f;
        #endregion

        #region General
        public const string DEFAULT_MEASURE_STRING = "A";
        public const int INITIAL_LIVES = 3;
        #endregion
        #endregion
        #endregion
    }
}